<template>
  <RouterView></RouterView>
  <Footer v-if="isFooter"></Footer>

</template>

<script setup>
import { RouterView } from 'vue-router';
import Footer from './components/footer/Footer.vue';
import { computed } from 'vue';
import { useRoute } from 'vue-router';

const route = useRoute()

const isFooter = computed(() => {
  // 定义需要显示底部导航的路由路径
  const showBottomRoutes = ['/home', '/category', '/orders', '/profile', '/'];
  
  // 检查当前路由是否在显示列表中
  return showBottomRoutes.includes(route.path);
  
  // 或者使用正则匹配
  // return /^\/(home|category|orders|profile)?$/.test(route.path);
  
  // 或者排除某些页面
  // const hideBottomRoutes = ['/login', '/register'];
  // return !hideBottomRoutes.includes(route.path);
});
</script>

<style scoped>
</style>
